package au.edu.swin.videoshop.persistence;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@NamedQueries({
	@NamedQuery (
			name="findAllTitleCategories", 
			query="SELECT tc FROM TitleCategoryEntity tc WHERE tc.deleted = FALSE"
	)
})
@Table(name="TITLE_CATEGORY")
public class TitleCategoryEntity implements Serializable{
	private Long mTitleCategoryId;
	private String mCategoryName;
	private String mDescription;
	
	//Attribute to mark the entity as deleted
	private boolean mDeleted;
	private String mDeleteInfo;
	
	public TitleCategoryEntity() {
		mDeleted = false;
	}
	
	/**
	 * @return the titleCategoryId
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="TITLE_CATEGORY_ID")
	public Long getTitleCategoryId() {
		return mTitleCategoryId;
	}
	
	/**
	 * @param titleCategoryId the titleCategoryId to set
	 */
	public void setTitleCategoryId(Long titleCategoryId) {
		mTitleCategoryId = titleCategoryId;
	}

	/**
	 * @return the categoryName
	 */
	@Column(name="CATEGORY_NAME", length=50)
	public String getCategoryName() {
		return mCategoryName;
	}
	
	/**
	 * @param categoryName the categoryName to set
	 */
	public void setCategoryName(String categoryName) {
		mCategoryName = categoryName;
	}
	
	/**
	 * @return the description
	 */
	@Column(name="CATEGORY_DESC", length=500)
	public String getDescription() {
		return mDescription;
	}
	
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		mDescription = description;
	}
	
	/**
	 * @return the deleted
	 */
	@Column(name="IS_DELETED")
	public boolean isDeleted() {
		return mDeleted;
	}
	
	/**
	 * @param deleted the deleted to set
	 */
	public void setDeleted(boolean deleted) {
		mDeleted = deleted;
	}
	
	/**
	 * @return the deleteInfo
	 */
	@Column(name="DELETE_INFO")
	public String getDeleteInfo() {
		return mDeleteInfo;
	}
	
	/**
	 * @param deleteInfo the deleteInfo to set
	 */
	public void setDeleteInfo(String deleteInfo) {
		mDeleteInfo = deleteInfo;
	}
}
